﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="UserManageAdd.ascx.cs"
    Inherits="TCDC_System.UserControl.UserManageAdd" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<style type="text/css">
    .icon-exclamation
    {
        padding-left: 25px !important;
        background: url(../../Attribute/images/icons/System/exclamation.png) no-repeat 3px 3px !important;
    }
    .icon-accept
    {
        padding-left: 25px !important;
        background: url(../../Attribute/images/icons/System/accept.png) no-repeat 3px 3px !important;
    }
</style>
<ext:Window ID="WindowUserManageAdd" runat="server" Icon="Group" Title="User Manage" Width="600"
    Height="300" AutoShow="false" Modal="true" Hidden="true" Layout="Fit">
    <TopBar>
        <ext:Toolbar ID="Toolbar1" runat="server">
            <Items>
                <ext:ToolbarFill ID="ToolbarFill1" runat="server" />
                <ext:Button ID="btnSaveRecord" runat="server" Icon="Disk" Text="Save">
                         <DirectEvents>
                              <Click OnEvent="SaveUser" Before="return #{FormPanel1}.getForm().isValid();"> 
                                   <EventMask ShowMask="true"/>
                              </Click>
                         </DirectEvents>
                </ext:Button>
            </Items>
        </ext:Toolbar>
    </TopBar>
    <Items>
        <ext:FormPanel ID="FormPanel1" runat="server" Padding="5" Frame="true" LabelWidth="150"
            MonitorValid="true" Width="500" DefaultAnchor="-20" Height="230">
            <Items>
                <ext:ComboBox ID="cmbUserType" runat="server" FieldLabel="User Type" Width="200"
                    MsgTarget="Side" AllowBlank="false" DisplayField="user_type_name_th" ValueField="user_type_id">
                    
                    <Store>
                        <ext:Store ID="StoreUserType" runat="server">
                            <Reader>
                                <ext:JsonReader IDProperty="user_type_id">
                                    <Fields>
                                        <ext:RecordField Name="user_type_id" />
                                        <ext:RecordField Name="user_type_name_th" />
                                        <ext:RecordField Name="user_type_name_en" />
                                    </Fields>
                                </ext:JsonReader>
                            </Reader>
                        </ext:Store>
                    </Store>
                </ext:ComboBox>
                <ext:TextField ID="txtUsername" runat="server" FieldLabel="Username" Width="200" AllowBlank="false"
                    MsgTarget="Side" />
                <ext:TextField ID="txtPassword" runat="server" FieldLabel="Password" InputType="Password"
                    Width="200" AllowBlank="false" MsgTarget="Side">
                </ext:TextField>
                <ext:TextField ID="txtConPassword" runat="server" Vtype="password" FieldLabel="Confirm Password"
                    InputType="Password" MsgTarget="Side" Width="200" AllowBlank="false">
                    <CustomConfig>
                        <ext:ConfigItem Name="initialPassField" Value="#{txtPassword}" Mode="Value" />
                    </CustomConfig>
                </ext:TextField>
            </Items>
            <BottomBar>
                <ext:StatusBar ID="StatusBar1" runat="server" Height="25" />
            </BottomBar>
            <Listeners>
                <ClientValidation Handler="this.getBottomToolbar().setStatus({text : valid ? 'Form is valid' : 'Form is invalid', iconCls: valid ? 'icon-accept' : 'icon-exclamation'});" />
            </Listeners>
        </ext:FormPanel>
    </Items>
</ext:Window>
